"""DataFactory URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.contrib import admin
from django.urls import path, re_path

from myapp.DIY_views import *
from myapp.views import *
from myapp.GM_views import *

urlpatterns = [
    path('admin/', admin.site.urls),
    path("home/", into_home),  # 主页
    path('get_diy_tools_list/', get_diy_tools_list),  # 获取自定义工具列表
    path("get_useCount/", get_useCount), # 数据统计
    path("get_data/", get_data),
    path("test2/", test2),

    # 用户相关
    path("accounts/login/", into_login),  # 打开登录页面
    path("login_act/", login_act),  # 登录
    path("logout/", logout),  # 注销
    path("register_act/", register_act),  # 注册
    path("add_href/", add_href),

    # 官方工具
    ### 构造房源
    path("GM_tools/house/", house),  # 进入房源构造页面
    path("GM_tools/house_check_user/", house_check_user),  # 验证输入的用户名密码
    path("GM_tools/house_run/", house_run),  # 开始构造房源

    ### 构造订单
    path("GM_tools/order/", house),  # 进入订单构造页面
    path("GM_tools/order_run/", order_run),  # 开始构造订单

    ### 统一部分
    re_path("add_step/(?P<tid>.*)/", add_step),  # 增加步骤

    # 自定义工具
    path('add_diy_tool/', add_diy_tool),  # 创建工具
    re_path('DIY_tools/(?P<tid>.*)/', DIY_tools),  # 进入工具
    re_path('add_DIY_step/(?P<tid>.*)/', add_DIY_step),  # 增加步骤
    re_path('del_DIY_step/(?P<sid>.*)/', del_DIY_step),  # 删除步骤
    path('DIY_tools_save_NameAndDes/', DIY_tools_save_NameAndDes),  # 保存工具标题和描述
    path('DIY_tools_add_input/', DIY_tools_add_input),  # 增加一个输入
    path('get_DIY_tools_all_inputs/', get_DIY_tools_all_inputs),  # 获取最新的all_inputs
    path('DIY_tools_del_input/', DIY_tools_del_input),  # 删除一个输入
    path('DIY_tools_save_input/', DIY_tools_save_input),  # 保存一个输入
    path('DIY_tools_get_step/', DIY_tools_get_step),  # 获取步骤数据
    re_path('DIY_tools_save_step/(?P<sid>.*)/', DIY_tools_save_step),  # 保存步骤数据
    path('DIY_tools_tool/tool_diff_play/', tool_diff_play),  # 运行diff_json工具
    path('DIY_tools_tool/tool_recheck_play/', tool_recheck_play),  # 运行正则检查工具
    path('DIY_tools_get_log/', DIY_tools_get_log),  # 获取日志
    re_path('DIY_tools_del_log/(?P<tid>.*)/', DIY_tools_del_log),  # 删除日志
    path('DIY_tools_get_variable_log/', DIY_tools_get_variable_log),  # 获取步骤可用变量
    re_path('change_DIY_model/(?P<tid>.*)/', change_DIY_model), # 自定义工具变更模式
    path("DIY_tools_run/", DIY_tools_run),



    path("test/", test),
    re_path("^$", into_home),
]
